<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="kines.ct.*"%>
<%
	int mes, anio, dia;
	String monthNames[] = {"ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE"};
	try{
		mes = Integer.parseInt( request.getParameter("mes"));
		dia = Integer.parseInt( request.getParameter("dia"));
		anio = Integer.parseInt( request.getParameter("anio"));
	}catch( Exception ex ){
		mes = -1;
		dia = -1;
		anio = -1;
	}
%>
<html>
<head>
<title>Detalle Agenda</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../css/arastyle.css" type="text/css">
<SCRIPT language=JavaScript>
// -->
var win1 = null;
//----------
	function DescripcionEvento(IdRegistro){
		win1 = window.open('DescripcionEventoNuevo.jsp?Id_Registro='+IdRegistro,'Descripcion_E','top=100,left=100,width=600,height=250,resizable=yes,status=yes,scrollbars=yes');	
	}
//----------- cierra las ventanas que se hayan abierto
	function cerrarventanas() {
		obj1 = eval("win1");
		if (obj1 && !obj1.closed) {
			obj1.close();
		}			
	}
</script>
</head>
<body class="fondo" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" rightmargin="0" onUnload="cerrarventanas();">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bgcolor="#C2C2C2">
  <tr>
    <td class="titulos" colspan="2"><div align="center">Detalle Agenda ( <%=dia+"/"+monthNames[mes-1]+"/"+anio%> )</div></td>
  </tr>
  <%for( int i = 0; i < 24; i++ ){%>
  <tr>
    <td width="12%" class="titcolumna" ><div align="center"><%=i%>:00</div></td>
    <td width="88%">
	<%
		Agend agenda = new Agend( session, mes, anio );
		Object [] eventos = agenda.getEvents(dia,i,0);
		if( eventos != null ){
			for (int j = 0; j < eventos.length; j++) {
				Event evento = (Event)eventos[j];
				if( j++ != 0 )out.println("<br>");
				out.println("<Font class=\"textcolumna\"><a href=\"javascript:DescripcionEvento('"+evento.getId()+"')\">"+evento.getRemarks()+"</a></Font>");
			}
		}
	%>
	&nbsp;
	</td>
  </tr>
  <tr>
    <td width="12%" class="titcolumna" ><div align="center"><%=i%>:30</div></td>
    <td width="88%">
	<%
		eventos = agenda.getEvents(dia,i,30);
		if( eventos != null ){
			for (int j = 0; j < eventos.length; j++) {
				Event evento = (Event)eventos[j];
				if( j++ != 0 )out.println("<br>");
				out.println("<Font class=\"textcolumna\"><a href=\"javascript:DescripcionEvento('"+evento.getId()+"')\">"+evento.getRemarks()+"</a></Font>");
			}
		}
	%>
	&nbsp;
	</td>
  </tr>
  <%}%>
</table>
</body>
</html>
